#ifndef __INCLUDED_PROP_MATRIX_H_
#define __INCLUDED_PROP_MATRIX_H_

#include "UUTConsoleBase.h"

class CPropItem;
class CPropItemBuilder;

typedef vector<CPropItem*> arrProps;
typedef arrProps::iterator itProp;
typedef arrProps::const_iterator citProp;

typedef vector<UUTPropValue*> arrPropValue;
typedef arrPropValue::iterator itPropValue;
typedef arrPropValue::const_iterator citPropValue;

class CPropItem
{
public:
	CPropItem();
	virtual ~CPropItem();

public:
	virtual UUTBool InitOptionsWithString(const UUTTString& str) = 0;
	void SetID(const UUTTString& id) { m_id = id;};

public:
	itPropValue Begin() { return m_values.begin();};
	itPropValue End() { return m_values.end();};
	itPropValue PresentRead() { return m_presentRead;}
	void IncreasePresentRead() { ++ m_presentRead;}
	void ResetPresentRead() { m_presentRead = m_values.begin();}
	const UUTTString& GetID() { return m_id; };

protected:
	arrPropValue			m_values;
	UUTTString				m_id;
	itPropValue				m_presentRead;

private:
	DisalowCopyAssign(CPropItem);
	void ClearAll();
};

class CPropItemBuilder{
public:
	static CPropItem* MakeItem(const UUTTString& id, const UUTTString& type,const UUTTString& str);
};

//////////////////////////////////////////////////////////////////////////
//

class CPropList
{
public:
	CPropList();
	virtual ~CPropList();

public:
	void AddItem(const UUTTString& id, const UUTTString& type,const UUTTString& str);

	enum EmitOpResult{
		EmitResult_Init = 0,
		EmitResult_OK = 1,
		EmitResult_NoMoreProps = 2,
		EmitResult_NoReceiver = 3,
		EmitResult_InternalError
	};
	EmitOpResult EmitProps(IUUTPropReceiver* receiver);

private:
	arrProps m_props;
	UUTBool  m_emitStarted;

	void ClearAll();
	void ResetPropPositionTo(itProp end);

private:
	DisalowCopyAssign(CPropList);
};

#endif //__INCLUDED_PROP_MATRIX_H_